#ifndef TRANSACTION_TYPES_H
#define TRANSACTION_TYPES_H 1

#include <stdint.h>

#define TRANSACTION_MAX_ID ((4 * 1024 * 1024 * 1024) - 1)
typedef uint32_t transaction_id_t;
#define COMMAND_MAX_ID ((64 * 1024) - 1)
typedef uint16_t command_id_t;

typedef enum transaction_phase_e {
	UNKNOWN, /* Before registering the transaction */

	ACTIVE,
	PARTIALLY_COMMITED,
	FAILED,
	ABORTED,
	COMMITED,
} transaction_phase_e;

typedef enum transaction_isolation_e {
	DIRTY_READ,      /* Read anything that was not destroyed. Not implemented. */
	READ_COMMITTED,  /* Read whatever was commited at time the query was executed. */
	REPEATABLE_READ, /* Read whatever was commited at time the transaction was opened. */
	SERIALIZED,      /* Read and lock, same as REPEATABLE_READ. Not implemented. */
} transaction_isolation_e;

#endif
